﻿<Window x:Class="AvalonDock.BindingSample.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:ad="clr-namespace:AvalonDock;assembly=AvalonDock"
        xmlns:local="clr-namespace:AvalonDock.BindingSample"
        Title="MainWindow" Height="350" Width="525">
    <Window.CommandBindings>
        <!--<CommandBinding Command="{x:Static local:CustomCommands.MyCommand}" CanExecute="OnCanExecuteMyCommand" Executed="OnExecutedMyCommand"/>-->
    </Window.CommandBindings>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="24"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        <Menu>
            <MenuItem Header="Add Item" Click="OnAddItem"/>
        </Menu>
        <ad:DockingManager Grid.Row="1">
            <ad:ResizingPanel>
                <ad:DockablePane ad:ResizingPanel.ResizeWidth="100">
                    <ad:DockableContent Title="Sample Content">
                        <ad:DockableContent.CommandBindings>
                            <CommandBinding Command="{x:Static local:CustomCommands.MyCommand}" CanExecute="OnCanExecuteMyCommand" Executed="OnExecutedMyCommand"/>
                        </ad:DockableContent.CommandBindings>
                        <ListBox x:Name="listBoxToBind" ItemsSource="{Binding Path=MainWindow.SampleCollection, Source={x:Static local:App.Current}}">
                            <ListBox.ContextMenu>
                                <ContextMenu>
                                    <MenuItem Command="{x:Static local:CustomCommands.MyCommand}"/>
                                </ContextMenu>
                            </ListBox.ContextMenu>
                        </ListBox>
                    </ad:DockableContent>
                </ad:DockablePane>
                <ad:DocumentPane/>
            </ad:ResizingPanel>
        </ad:DockingManager>
    </Grid>
</Window>
